package com.ais.dao;

import java.util.List;

import com.ais.vo.Deptment;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;
@Repository("deptmentDao")
public class DeptmentDao extends SqlMapClientDaoSupport{

    public DeptmentDao() {
        super();
    }

    public int deleteByPrimaryKey(Integer id) {
        Deptment _key = new Deptment();
        _key.setId(id);
        int rows = getSqlMapClientTemplate().delete("dep.deleteByPrimaryKey", _key);
        return rows;
    }

    public void insert(Deptment record) {
        getSqlMapClientTemplate().insert("dep.insert", record);
    }

    public void insertSelective(Deptment record) {
        getSqlMapClientTemplate().insert("dep.insertSelective", record);
    }

    public Deptment selectByPrimaryKey(Integer id) {
        Deptment _key = new Deptment();
        _key.setId(id);
        Deptment record = (Deptment) getSqlMapClientTemplate().queryForObject("dep.selectByPrimaryKey", _key);
        return record;
    }

    public int updateByPrimaryKeySelective(Deptment record) {
        int rows = getSqlMapClientTemplate().update("dep.updateByPrimaryKeySelective", record);
        return rows;
    }

    public int updateByPrimaryKey(Deptment record) {
        int rows = getSqlMapClientTemplate().update("dep.updateByPrimaryKey", record);
        return rows;
    }

	public List<Deptment> getDeptmentList() {
		return getSqlMapClientTemplate().queryForList("dep.getDeptmentList");
	}
}